package jp.co.nikkeibp.android.Hello;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.os.Vibrator;
import android.view.View;
import android.widget.Button;
import android.widget.TableLayout;
import android.widget.TableRow;

public class HelloActivity extends Activity {
	/** Called when the activity is first created. */
	private Button bt[][];

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		TableLayout ttt = new TableLayout(this);

		TableRow rrr = null;
		bt = new Button[5][5];
		for (int i = 0; i < bt.length; i++) {
			rrr = new TableRow(this);
			ttt.addView(rrr);
			for (int j = 0; j < bt[0].length; j++) {
				bt[i][j] = new Button(this);
				bt[i][j].setText("(" + i + "," + j + ")");
				bt[i][j].setOnClickListener(new View.OnClickListener() {
					public void onClick(View v) {
						// Vibrator vvv
						// =(Vibrator)getSystemService(VIBRATOR_SERVICE);
						// vvv.vibrate(3000);

					
					}
				});
				rrr.addView(bt[i][j]);
			}
		}

		setContentView(ttt);
	}

}